# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.AnalyticsAdmin.V1beta.Model.GoogleAnalyticsAdminV1betaCustomDimension do
  @moduledoc """
  A definition for a CustomDimension.

  ## Attributes

  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. Description for this custom dimension. Max length of 150 characters.
  *   `disallowAdsPersonalization` (*type:* `boolean()`, *default:* `nil`) - Optional. If set to true, sets this dimension as NPA and excludes it from ads personalization. This is currently only supported by user-scoped custom dimensions.
  *   `displayName` (*type:* `String.t`, *default:* `nil`) - Required. Display name for this custom dimension as shown in the Analytics UI. Max length of 82 characters, alphanumeric plus space and underscore starting with a letter. Legacy system-generated display names may contain square brackets, but updates to this field will never permit square brackets.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Output only. Resource name for this CustomDimension resource. Format: properties/{property}/customDimensions/{customDimension}
  *   `parameterName` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. Tagging parameter name for this custom dimension. If this is a user-scoped dimension, then this is the user property name. If this is an event-scoped dimension, then this is the event parameter name. If this is an item-scoped dimension, then this is the parameter name found in the eCommerce items array. May only contain alphanumeric and underscore characters, starting with a letter. Max length of 24 characters for user-scoped dimensions, 40 characters for event-scoped dimensions.
  *   `scope` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. The scope of this dimension.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :description => String.t() | nil,
          :disallowAdsPersonalization => boolean() | nil,
          :displayName => String.t() | nil,
          :name => String.t() | nil,
          :parameterName => String.t() | nil,
          :scope => String.t() | nil
        }

  field(:description)
  field(:disallowAdsPersonalization)
  field(:displayName)
  field(:name)
  field(:parameterName)
  field(:scope)
end

defimpl Poison.Decoder,
  for: GoogleApi.AnalyticsAdmin.V1beta.Model.GoogleAnalyticsAdminV1betaCustomDimension do
  def decode(value, options) do
    GoogleApi.AnalyticsAdmin.V1beta.Model.GoogleAnalyticsAdminV1betaCustomDimension.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.AnalyticsAdmin.V1beta.Model.GoogleAnalyticsAdminV1betaCustomDimension do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
